package io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class IODemo6 {
    public static void main(String[] args) {
        try (Reader reader = new FileReader("test.txt")) {

          /*  while (true){
                //这里的类型是char类型
                char[] buffer=new char[1024];
                int n=reader.read(buffer);
                if (n==-1){
                    break;
                }
                for (int i = 0; i <n ; i++) {
                    System.out.print(buffer[i]);
                }

                String s = new String(buffer, 0, n);
                System.out.println(s);

            }*/
            while (true){

                int n= reader.read();
                if (n==-1){
                    break;
                }
                System.out.print((char)n+" ");

            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
